package jhub.text;

import java.text.MessageFormat;
import java.text.ParseException;

import jhub.DCProtocol;

public class PassiveSearchMessage extends DCRawCommand{
    
    private String nick;
    private String searchstring;
    
    
    public PassiveSearchMessage(String command) throws ParseException {
        super(command);
        parse();
    }
    
    private void parse() throws ParseException{
        Object[] o = new MessageFormat(DCProtocol.PASSIVE_SEARCH_FORMAT).parse(command.toString());
        setNick(o[0].toString());
        searchstring = o[1].toString();
    }

    public String getSearchstring() {
        return searchstring;
    }

    public void setSearchstring(String searchstring) {
        this.searchstring = searchstring;
    }

    public String getNick() {
        return nick;
    }

    public void setNick(String nick) {
        this.nick = nick;
    }
}
